home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / PROGRAMMING / DOCS / ZEROPAGE < prev    next >
Text File  |  1996-10-06  |  14KB  |  497 lines

  1.   This is an incomplete list of the allocation of address space in 'zero page'.
  2.   It is currently maintained by Matthew Wilcox <mrw103@york.ac.uk> and is
  3.   available as ftp://ftp.barnet.ac.uk/pub/Acorn/zeropage.txt or as
  4.   http://www.york.ac.uk/~mrw103/zeropage.txt.  If you can't get it using
  5.   either of these methods then mail me, asking *nicely*.  Please mail me any
  6.   corrections or additions to me so they can be incorporated into the list.
  7.   I would be particularly interested in differences in other versions of RISC
  8.   OS.  Last updated on Mon 07th October 1996
  9.  
  10.   Credits (alphabetically):
  11.   Carol Carpenter for providing space on Barnet's FTP site for this document
  12.   Ben Dooks for telling me the base of the Vector table & for writing VecList
  13.   Nick Smith for reading RAM speed & MEMC type from zero page in !ArmSI
  14.   Mark Wooding for mentioning that DDEUtils frobbed around in zero page
  15.  
  16.   All addresses are given in hexadecimal and refer to the start of the word
  17.   containing the value.  Where a range is given, it is given to the beginning
  18.   of the last word in the range.  These addresses were valid on my 4Mb A440
  19.   running RISC OS 3.1.  None of them are guaranteed to remain in the same
  20.   place between different versions of the OS.  Some will definitely be
  21.   different under RISC OS 3.5+.  Always use the defined system interfaces in
  22.   preference to direct accesses if possible.  No liability is assumed for any
  23.   loss or damage which may result as the result of yourself or others use or
  24.   misuse of the information contained in this document.
  25.  
  26.   Address        Contents
  27.  
  28.   0         Branch Through Zero handler
  29.   4         Undefined Instruction handler
  30.   8         Software Interrupt handler
  31.   C         Prefetch Abort handler
  32.   10        Data Abort handler
  33.   14        Address Exception handler
  34.   18        IRQ handler
  35.   1C - FC        FIQ routine
  36.   100       Address called by ROM IRQ handler routine. (&C34)
  37.   104  Bit 4     Escape condition occured
  38.   108       Value of R13_irq after last IRQ happened
  39.   10C       Monotonic time
  40.   110  Byte 0    } RAM speed
  41.        Byte 1    }
  42.        Bit 16    MEMC1 if clear, MEMC1a if set
  43.   114  Bit 2     } used by OS_SetMemMapEntries.  Not understood how.
  44.        Bit 3     }
  45.   118       [has value 0.  Is it unused?]
  46.   11C       MemoryLimit value
  47.   120       Undefined instruction handler address
  48.   124       Prefetch abort handler address
  49.   128       Data abort handler address
  50.   12C       Address exception handler address
  51.   130       Error handler address
  52.   134       Error buffer address
  53.   138       R0 on entry to Error handler
  54.   13C       R12 on entry to CallBack handler
  55.   140       CallBack handler address
  56.   144       Pointer to CallBack register buffer
  57.   148       R12 on entry to BreakPoint handler
  58.   14C       BreakPoint handler address
  59.   150       Pointer to BreakPoint register buffer
  60.   154       R12 on entry to Escape handler
  61.   158       Escape handler address
  62.   15C       R12 on entry to Event handler
  63.   160       Event handler address
  64.   164 - 360 Page tables.  Top nybble contains page protection level
  65.  
  66.   364 - 560 Here be dragons.  All zero, too.  Unused?
  67.  
  68.   564       Address of page tables
  69.   568       Highest page number
  70.   56C       Total amount of RAM in machine in bytes
  71.   570       Application space
  72.   574       R12 on entry to Unused SWI handler
  73.   578       Unused SWI handler address
  74.   57C       Exit handler address
  75.   580       R12 on entry to Exit handler
  76.   584       R12 on entry to UpCall handler
  77.   588       UpCall handler address
  78.   58C
  79.   590
  80.   594
  81.   598  Byte 0
  82.        Byte 1
  83.        Byte 2
  84.        Byte 3    Keyboard ID
  85.   59C
  86.   5A0
  87.   5A4
  88.   5A8
  89.   5AC
  90.   5B0
  91.   5B4
  92.   5B8
  93.   5BC
  94.   5C0       Mouse X multiplier
  95.   5C4       Mouse Y multiplier
  96.   5C8       Address of keyboard handler
  97.  
  98.   5CC - 7CC The Great Swamp
  99.  
  100.   7D0       Pointer to Module chain
  101.   7D4       Currently Active Object pointer
  102.   7D8       UserV          (00)
  103.   7DC       ErrorV         (01)
  104.   7E0       IrqV      (02)
  105.   7E4       WrchV          (03)
  106.   7E8       RdchV          (04)
  107.   7EC       CLIV      (05)
  108.   7F0       ByteV          (06)
  109.   7F4       WordV          (07)
  110.   7F8       FileV          (08)
  111.   7FC       ArgsV          (09)
  112.   800       BGetV          (0A)
  113.   804       BPutV          (0B)
  114.   808       GBPBV          (0C)
  115.   80C       FindV          (0D)
  116.   810       ReadLineV (0E)
  117.   814       FSCV      (0F)
  118.   818       EventV         (10)
  119.   81C       *V        (11) }
  120.   820       *V        (12) } These vectors reserved by Acorn
  121.   824       *V        (13) }
  122.   828       InsV      (14)
  123.   82C       RemV      (15)
  124.   830       CnpV      (16)
  125.   834       UKVDU23V  (17)
  126.   838       UKSWIV         (18)
  127.   83C       UKPLOTV        (19)
  128.   840       MouseV         (1A)
  129.   844       VDUXV          (1B)
  130.   848       TickerV        (1C)
  131.   84C       UpcallV        (1D)
  132.   850       ChngEnvirnmentV     (1E)
  133.   854       SpriteV        (1F)
  134.   858       DrawV          (20)
  135.   85C       EconetV        (21)
  136.   860       ColourV        (22)
  137.   864       PaletteV  (23)
  138.   868       SerialV        (24)
  139.   86C       *V        (25) }
  140.   870       *V        (26) }
  141.   874       *V        (27) }
  142.   878       *V        (28) }
  143.   87C       *V        (29) }
  144.   880       *V        (2A) } These vectors reserved by Acorn
  145.   884       *V        (2B) }
  146.   888       *V        (2C) }
  147.   88C       *V        (2D) }
  148.   890       *V        (2E) }
  149.   894       *V        (2F) }
  150.   898       Pointer to exception registers
  151.  
  152.   89C - A38 Garroting Deep
  153.  
  154.   A3C  Byte 0
  155.        Byte 1
  156.        Byte 2
  157.        Byte 3    [referred to by ROM PaletteV]
  158.  
  159.   A40 - AC8 Northron Climbs
  160.  
  161.   ACC       Current size of sprite area
  162.   AD0       Current size of RAM filing system
  163.   AD4       Current size of font cache
  164.   AD8       Base of OS_CallEvery/CallAfter list
  165.   ADC       first 4 bytes of time that program was started
  166.   AE0  Byte 0    last byte of time that program was started
  167.        Byte 1    input file handle
  168.        Byte 2    output file handle
  169.        Byte 3
  170.   AE4  Bit 8     } [referenced by kernel swi exit routines]
  171.        Bit 9     }
  172.        Bit 10    Outstanding OS_AddCallback.
  173.        Bit 16    IOEB ASIC present
  174.        Bit 17    82C710 present
  175.        Bit 18    LCD ASIC present
  176.        Bit 19    82C711 present
  177.   AE8-BE4        Program environment string
  178.   BE8
  179.   BEC
  180.   BF0
  181.   BF4
  182.   BF8
  183.   BFC
  184.   C00
  185.   C04
  186.   C08
  187.   C0C
  188.   C10
  189.   C14
  190.   C18
  191.   C1C
  192.   C20
  193.   C24
  194.   C28       page size in bytes
  195.   C2C
  196.   C30
  197.   C34       MOV  r3, #&03200000      }
  198.   C38       LDRB r0, [r3, #36]       }
  199.   C3C       CMP  r0, #0              }
  200.   C40       LDREQB    r0, [r3, #20]        }
  201.   C44       ADREQ     r1, &D24       } IRQ handler routine
  202.   C48       ADRNE     r1, &E24       }
  203.   C4C       LDRB r0, [r1, r0]        }
  204.   C50       ADD  r1, pc, r0, LSL #2  }
  205.   C54       LDMIA     r1, {r12, pc}        }
  206.   C58       R12 value for device 0 vector
  207.   C5C       Address of device 0 handler
  208.   C60       points to next handler for device 0
  209.   C64       R12 value for device 1 vector
  210.   C68       Address of device 1 handler
  211.   C6C       points to next handler for device 1
  212.   C70       R12 value for device 2 vector
  213.   C74       Address of device 2 handler
  214.   C78       points to next handler for device 2
  215.   C7C       R12 value for device 3 vector
  216.   C80       Address of device 3 handler
  217.   C84       points to next handler for device 3
  218.   C88       R12 value for device 4 vector
  219.   C8C       Address of device 4 handler
  220.   C90       points to next handler for device 4
  221.   C94       R12 value for device 5 vector
  222.   C98       Address of device 5 handler
  223.   C9C       points to next handler for device 5
  224.   CA0       R12 value for device 6 vector
  225.   CA4       Address of device 6 handler
  226.   CA8       points to next handler for device 6
  227.   CAC       R12 value for device 7 vector
  228.   CB0       Address of device 7 handler
  229.   CB4       points to next handler for device 7
  230.   CB8       R12 value for device 8 vector
  231.   CBC       Address of device 8 handler
  232.   CC0       points to next handler for device 8
  233.   CC4       R12 value for device 9 vector
  234.   CC8       Address of device 9 handler
  235.   CCC       points to next handler for device 9
  236.   CD0       R12 value for device 10 vector
  237.   CD4       Address of device 10 handler
  238.   CD8       points to next handler for device 10
  239.   CDC       R12 value for device 11 vector
  240.   CE0       Address of device 11 handler
  241.   CE4       points to next handler for device 11
  242.   CE8       R12 value for device 12 vector
  243.   CEC       Address of device 12 handler
  244.   CF0       points to next handler for device 12
  245.   CF4       R12 value for device 13 vector
  246.   CF8       Address of device 13 handler
  247.   CFC       points to next handler for device 13
  248.   D00       R12 value for device 14 vector
  249.   D04       Address of device 14 handler
  250.   D08       points to next handler for device 14
  251.   D0C       R12 value for device 15 vector
  252.   D10       Address of device 15 handler
  253.   D14       points to next handler for device 15
  254.   D18       R12 value for no device
  255.   D1C       address of no device handler
  256.   D20       points to next handler for no device
  257.   D24 - E20 IRQ register A priority table
  258.   E24 - F20 IRQ register B priority table
  259.   F24       Base of AddCallBack list
  260.   F28
  261.   F2C
  262.   F30
  263.   F34
  264.   F38
  265.   F3C
  266.   F40
  267.   F44
  268.   F48
  269.   F4C
  270.   F50
  271.   F54
  272.   F58
  273.   F5C
  274.   F60
  275.   F64       Unique Machine ID word 0
  276.   F68       Unique Machine ID word 1
  277.   F6C
  278.   F70
  279.   F74
  280.   F78
  281.   F7C
  282.   F80  Byte 0    Kernel flag to prevent reentering MessageTrans_ErrorLookup
  283.        Byte 1
  284.        Byte 2
  285.        Byte 3
  286.   F84
  287.   F88
  288.   F8C
  289.   F90
  290.   F94
  291.   F98
  292.   F9C
  293.   FA0
  294.   FA4
  295.   FA8
  296.   FAC
  297.   FB0
  298.   FB4
  299.   FB8
  300.   FBC
  301.   FC0
  302.   FC4
  303.   FC8
  304.   FCC
  305.   FD0
  306.   FD4
  307.   FD8
  308.   FDC
  309.   FE0
  310.   FE4
  311.   FE8
  312.   FEC
  313.   FF0
  314.   FF4
  315.   FF8       Bottom 16 bits of task handle
  316.   FFC
  317.  
  318.   It appears to me that everything VDU related is stored after &1000.
  319.  
  320.   1000
  321.   1004
  322.   1008
  323.   100C
  324.   1010
  325.   1014
  326.   1018
  327.   101C
  328.   1020
  329.   1024
  330.   1028
  331.   102C
  332.   1030
  333.   1034
  334.   1038
  335.   103C
  336.   1040      GCOL action for foreground colour [151]
  337.   1044      GCOL action for background colour [152]
  338.   1048      Graphics foreground colour [153]
  339.   104C      Graphics background colour [154]
  340.   1050      Left-hand column of the graphics window [128]
  341.   1054      Bottom row of the graphics window [129]
  342.   1058      Right-hand column of the graphics window [130]
  343.   105C      Top row of the graphics window [131]
  344.   1060
  345.   1064
  346.   1068
  347.   106C
  348.   1070
  349.   1074
  350.   1078
  351.   107C      Amount of RAM required by current screen mode
  352.   1080
  353.   1084
  354.   1088      [referenced by RemoveCursors]
  355.   108C
  356.   1090      [referenced by RemoveCursors]
  357.   1094
  358.   1098
  359.   109C
  360.   10A0      [referenced by SetECFOrigin]
  361.   10A4
  362.   10A8
  363.   10AC
  364.   10B0
  365.   10B4      [referred to by ROM PaletteV]
  366.   10B8
  367.   10BC
  368.   10C0      Address of the start of screen used by VDU drivers [148]
  369.   10C4      [referenced by SetECFOrigin]
  370.   10C8
  371.   10CC
  372.   10D0
  373.   10D4
  374.   10D8
  375.   10DC
  376.   10E0      Left-hand column of the text window [132]
  377.   10E4      Bottom row of the text window [133]
  378.   10E8      Right-hand column of the text window {134]
  379.   10EC      Top row of the text window [135]
  380.   10F0      x coordinate of the graphics origin (ec) [136]
  381.   10F4      y coordinate of the graphics origin (ec) [137]
  382.   10F8      x coordinate of the graphics cursor (ec) [138]
  383.   10FC      y coordinate of the graphics cursor (ec) [139]
  384.   1100      x coordinate of oldest graphics cursor (ic) [140]
  385.   1104      y coordinate of oldest graphics cursor (ic) [141]
  386.   1108      x coordinate of previous graphics cursor (ic) [142]
  387.   110C      y coordinate of previous graphics cursor (ic) [143]
  388.   1110      x coordinate of the graphics cursor (ic) [144]
  389.   1114      y coordinate of the graphics cursor (ic) [145]
  390.   1118      x coordinate of new point (ic) [146]
  391.   111C      y coordinate of new point (ic) [147]
  392.   1120      Text foreground colour [155]
  393.   1124      Text background colour [156]
  394.   1128
  395.   112C
  396.   1130      [referenced by RemoveCursors]
  397.   1134
  398.   1138
  399.   113C      [referenced by RemoveCursors]
  400.   1140
  401.   1144
  402.   1148
  403.   114C
  404.   1150
  405.   1154
  406.   1158
  407.   1160
  408.   1164
  409.   1168
  410.   116C
  411.   1170
  412.   1174
  413.   1178      Address of the start of screen used by display hardware [149]
  414.   117C
  415.   1180
  416.   1184      Highest logical colour number available in this mode
  417.   1188
  418.   118C
  419.   1190
  420.   1194
  421.   1198
  422.   119C
  423.   11A0
  424.   11A4
  425.   11A8
  426.   11AC
  427.   11B0
  428.   11B4
  429.   11B8
  430.   11BC
  431.   11C0
  432.   11C4
  433.   11C8
  434.   11CC
  435.   11D0      Current screen mode number
  436.   11D4      Tint for text foreground colour [159]
  437.   11D8      Tint for text background colour [160]
  438.   11DC      Tint for graphics foreground colour [157]
  439.   11E0      Tint for graphics background colour [158]
  440.   11E4      Amount of memory currently allocated to the screen [150]
  441.   11E8      Highest mode number available [161]
  442.   11EC
  443.   11F0 Bit 0     [referenced by ReadVduVars]
  444.        Bit 1     [referenced by ReadVduVars]
  445.        Bit 2     [referenced by ReadVduVars]
  446.        Bit 3     text printing direction vertical if set
  447.        Bit 9     Cursor state
  448.        Bit 21    ChangedBox calculation enabled if set
  449.        Bit 30    [referenced by ReadVduVars]
  450.   11F4      [referenced by RemoveCursors]
  451.   11F8
  452.   11FC
  453.   1200
  454.   1204
  455.   1208
  456.   120C
  457.   1210
  458.   1214
  459.   1218
  460.   121C
  461.   1220
  462.   1224
  463.   1228      VIDC clock speed in kHz [172]
  464.  
  465.   122C - 135C    Treacher's Gorge
  466.  
  467.   1360      x size of VDU 5 chars (in pixels) [162]
  468.   1364      y size of VDU 5 chars (in pixels) [163]
  469.   1368      x spacing of VDU 5 chars (in pixels) [164]
  470.   136C      y spacing of VDU 5 chars (in pixels) [165]
  471.   1370      x size of VDU 4 chars (in pixels) [167]
  472.   1374      y size of VDU 4 chars (in pixels) [168]
  473.   1378      x spacing of VDU 4 chars (in pixels) [169]
  474.   137C      y spacing of VDU 4 chars (in pixels) [170]
  475.   1380      Address of fast line-draw routine [166]
  476.   1384      Address of colour blocks for current GCOLs [171]
  477.  
  478.   1388 - 159C    Spoiled Plains
  479.  
  480.   15A0 Byte 0    ClaimScreenMemory flag
  481.        Byte 1
  482.        Byte 2
  483.        Byte 3
  484.  
  485.   15A4 - 1668    Doriendor Corishev
  486.  
  487.   166C      ChangedBox flag word
  488.   1670      ChangedBox x coordinate of left edge
  489.   1674      ChangedBox y coordinate of bottom edge
  490.   1678      ChangedBox x coordinate of right edge
  491.   167C      ChangedBox y coordinate of top edge
  492.  
  493.   1680 - 3FFC    Trackless wastes
  494.  
  495.   4000-7FFC RISC OS scratch space
  496.  
  497.